package com.qi.invokeserver.controller;

import com.qi.invokeserver.vo.InvokeRequest;
import com.qi.invokeserver.vo.InvokeResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 姚炜琦
 * @Classname InvokeServerController
 * @Description TODO
 * @Date 2022/11/28 23:23
 */
@Slf4j
@RestController
public class InvokeServerController {
    @RequestMapping(value = "/send", method = RequestMethod.POST)
    public InvokeResponse send(@RequestBody InvokeRequest request) {
        log.info("send - request:{}", request);

        InvokeResponse response = new InvokeResponse();
        response.setCode(1);
        response.setStatus("ok");
        response.setMsgId(System.nanoTime());
        response.setMsgContent("I konw you said: " + request.getMsgContent());

        return response;
    }

}
